package com.hospital.controller;

import com.hospital.entity.DepartInfo;
import com.hospital.entity.Department;
import com.hospital.service.intf.DepartInfoService;
import com.hospital.service.intf.DepartmentService;
import com.hospital.vo.PageBean;
import com.hospital.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fxy
 * @date 2022/8/29
 */
@RestController
@RequestMapping("/api/departinfo")
public class DepartInfoController {

    @Autowired
    private DepartInfoService departInfoService;

    @RequestMapping("/add.do")
    public R add(DepartInfo departInfo){
        return departInfoService.add(departInfo);
    }

    @RequestMapping("/delete.do")
    public R delete(Integer id){
        return departInfoService.delete(id);
    }

    @RequestMapping("/update.do")
    public R update(DepartInfo departInfo){
        return departInfoService.update(departInfo);
    }

    @RequestMapping("/selectPage.do")
    public PageBean selectPage(String name, int page, int limit){
        return departInfoService.selectPage(name, page, limit);
    }

    @RequestMapping("/department.do")
    public PageBean selectPageDepartmentEmployee(String departinfo, int page, int limit){
        return departInfoService.selectPage(departinfo, page, limit);
    }

    @RequestMapping("/query.do")
    public R query(){
        return departInfoService.query();
    }
}
